package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

public interface DishFlavorMapper {
    Integer saveBatch(@Param("dishFlavors") List<DishFlavor>dishFlavors);

    @Delete("DELETE FROM dish_flavor where dish_id=#{dishId}")
    void deleteByDishId(Long id);

    //根据菜品id查询口味列表
    @Select("select * from dish_flavor where dish_id=#{dishId}")
    List<DishFlavor> findAllByDishId(Long dishId);

    //批量删除菜品对应口味
    void deleteDishFlavorByIds(@Param("ids")  List<Long> ids,
                               @Param("opr") long opr,
                               @Param("updateTime") LocalDateTime updateTime);


}
